package com.letv.core.parser;

import org.apache.http.HttpStatus;
import org.json.JSONObject;

import com.letv.core.bean.RealPlayUrlInfoBean;

/**
 * 解析真实地址
 * 
 * @author zhuqiao
 *
 */
public class RealPlayUrlInfoParser extends LetvNormalParser<RealPlayUrlInfoBean> {

    @Override
    protected RealPlayUrlInfoBean parse(String data) throws Exception {
        JSONObject object = new JSONObject(data);

        RealPlayUrlInfoBean bean = new RealPlayUrlInfoBean();
        bean.setRealUrl(object.optString("location"));
        bean.setGeo(object.optString("geo"));
        bean.setCode(HttpStatus.SC_OK);
        bean.setCode(200);

        return bean;
    }

}
